<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //获得Date得总毫秒数
        //1.通过valueOf() getTime()
        var date = new Date();
        console.log(date.valueOf());
        console.log(date.getTime());

        //简单写法
        var date1 = +new Date();
        console.log(date1);

        //H5新增方式
        console.log(Date.now());
    </script>
</head>

<body>

</body>

</html>